<?php

namespace common\models;

use Yii;
use common\components\behaviors\ImageBehavior;
/**
 * This is the model class for table "dh_order_detail".
 *
 * @property integer $id
 * @property string $orderId
 * @property integer $num
 * @property integer $g_id
 * @property string $price
 * @property string $g_name
 * @property integer $img_id
 * @property integer $flag
 * @property integer $create_time
 */
class DhOrderDetail extends \common\components\ActiveRecord2015
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'dh_order_detail';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['num', 'g_id', 'img_id', 'flag', 'create_time'], 'integer'],
            [['price'], 'number'],
            [['orderId', 'g_name'], 'string', 'max' => 30]
        ];
    }
    public function behaviors() {
        return [
            'image' => [
                'class' => ImageBehavior::className()
            ]
        ];
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'orderId' => 'Order ID',
            'num' => 'num',
            'g_id' => 'G ID',
            'price' => 'Price',
            'g_name' => 'G Name',
            'img_id' => 'Img ID',
            'flag' => 'Flag',
            'create_time' => 'Create Time',
        ];
    }
}
